<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title> System</title>
    <link rel="stylesheet" href="../css/login.css">
    <script src="../vendors/jquery/dist/jquery.js"></script>
    <script src="../vendors/bootstrap/extend/Common.js"></script>
    <script src="../controllers/login/common.js"></script>
    <script src="../controllers/login/supersized.3.2.7.min.js"></script>
    <script src="../controllers/login/supersized-init.js"></script>
    <script src="../controllers/login/jquery.validate.min.js"></script>
    <script src="../vendors/jquery/dist/jquery.cookie.js"></script>
</head>
<body>

<div class="login-container">
    <h1><span class="red">敏捷开发平台</span></h1>

    <div class="connect">

    </div>

    <form id="loginForm">
        <div>
            <input type="text" id="username" name="username" class="username" placeholder="用户名" autocomplete="off"/>
        </div>
        <div>
            <input type="password" id="password" name="password" class="password" placeholder="密码"
                   oncontextmenu="return false" onpaste="return false"/>
        </div>
        <button id="btnsign" type="button">登 陆</button>
    </form>


</div>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
    <p>版本信息:V1.0 &nbsp;&nbsp;2017 © </p>
</div>

<script type="text/javascript">
    $(function () {
        var res='{  "my_project_count": 4,  "my_repo_count": 8,  "public_project_count": 4,  "public_repo_count": 8}'
        var storage = window.localStorage;
        storage.kubersummary=res;
        res='[{"name":"jenkins/jenkins_2.19.3","count": 7},{"name": "library/maven","count": 7}, {"name":"library/debian","count": 3},{"name": "library/hello-world","count": 2},{"name": "library/abh1nav_dockerui","count": 0}]'
        storage.kuberhot=res;
        res='{"Data":[{"name":"aaa","uid":"b7bea9b6-352e-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-10T03:14:02Z","status":"Active","resourceVersion":"7075430"},{"name":"aaasadasd","uid":"fc63c1c6-3613-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-11T06:35:12Z","status":"Active","resourceVersion":"7199807"},{"name":"asdasdsadasd","uid":"9484c6b1-360f-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-11T06:03:40Z","status":"Active","resourceVersion":"7197388"},{"name":"asddddd","uid":"fec55f7b-3613-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-11T06:35:16Z","status":"Active","resourceVersion":"7199814"},{"name":"dddddddd","uid":"006822a3-3614-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-11T06:35:19Z","status":"Active","resourceVersion":"7199818"},{"name":"default","uid":"615c19d1-ffe5-11e6-9793-000c29b7a2dd","creationTimestamp":"2017-03-03T07:45:32Z","status":"Active","resourceVersion":"6"},{"name":"gghh","uid":"4d5858bb-348a-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-09T07:37:06Z","status":"Active","resourceVersion":"6985723"},{"name":"haha","uid":"f8f128a3-2983-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-04-25T06:54:05Z","status":"Active","resourceVersion":"5456485"},{"name":"kube-system","uid":"615e60ef-ffe5-11e6-9793-000c29b7a2dd","creationTimestamp":"2017-03-03T07:45:32Z","status":"Active","resourceVersion":"9"},{"name":"wwww","uid":"8d1f5f06-352d-11e7-a5cf-000c29b7a2dd","creationTimestamp":"2017-05-10T03:05:41Z","status":"Active","resourceVersion":"7074762"}],"AllRows":10,"Success":true}'
        storage.kuberenvir=res;
        res='[{"maxCPU":5,"maxMenory":500,"nodePort":30004,"method":"get","namespace":"default","podIP":"172.17.12.2","hostIP":"10.142.20.208","containerPort":8080,"status":"Running","name":"jenkins-xbr2w","hostname":"10.142.20.208","image":"jenkins:2.46.2","uid":"fd3ec7eb-316b-11e7-a5cf-000c29b7a2dd"},{"maxCPU":5,"maxMenory":500,"nodePort":30005,"method":"get","namespace":"default","podIP":"172.17.12.4","hostIP":"10.142.20.208","containerPort":6379,"status":"Stopped","name":"redis-master-1m1w8","hostname":"10.142.20.208","image":"kubeguide/redis-master","uid":"ee81281a-2665-11e7-a5cf-000c29b7a2dd"},{"maxCPU":5,"maxMenory":500,"nodePort":30006,"method":"get","namespace":"default","podIP":"172.17.95.8","hostIP":"10.142.20.207","containerPort":6379,"status":"Running","name":"redis-master-z4jms","hostname":"10.142.20.207","image":"kubeguide/redis-master","uid":"fd402beb-316b-11e7-a5cf-000c29b7a2dd"},{"maxCPU":5,"maxMenory":500,"nodePort":30007,"method":"get","namespace":"default","podIP":"172.17.12.6","hostIP":"10.142.20.208","containerPort":6379,"status":"Running","name":"redis-slave-1g4m3","hostname":"10.142.20.208","image":"kubeguide/guestbook-redis-slave","uid":"bfadc0b6-361f-11e7-b659-000c29b7a2dd"},{"maxCPU":5,"maxMenory":500,"nodePort":30008,"method":"get","namespace":"default","podIP":"172.17.12.3","hostIP":"10.142.20.208","containerPort":6379,"status":"Running","name":"redis-slave-41jnl","hostname":"10.142.20.208","image":"kubeguide/guestbook-redis-slave","uid":"fd425134-316b-11e7-a5cf-000c29b7a2dd"}]';
            storage.kuberpods=res;
        res='[{"name":"10.142.20.208","hostip":"10.142.20.208","cpu":16,"memory":"16251856Ki","osImage":"CentOS Linux 7 (Core)","kernelVersion":"3.10.0-514.6.2.el7.x86_64","kubeletVersion":"v1.5.2",}{"name":"10.142.20.207","hostip":"10.142.20.207","cpu":16,"memory":"16251856Ki","osImage":"CentOS Linux 7 (Core)","kernelVersion":"3.10.0-514.6.2.el7.x86_64","kubeletVersion":"v1.5.2",}]'
        storage.kuberhosts=res;
        $("#password").bind("keydown", function (e) {
            keydown(e);
        });
        $("#btnsign").click(function () {
            formsubmit()
        })

    })
    function keydown(e) {
        if (e.keyCode == 13) {
            formsubmit();
        }
    }
    function formsubmit() {
        if ($("#username").val().IsNullOrEmpty()) {
            $("#username").siblings().remove();
            $("#password").siblings().remove();
            $("#username").after("<label id=\"username-error\" class=\"error\" for=\"username\">工号不能 为空</label>");
            return;
        }
        if ($("#password").val().IsNullOrEmpty()) {
            $("#username").siblings().remove();
            $("#password").siblings().remove();
            $("#password").after("<label id=\"username-error\" class=\"error\" for=\"username\">密码不能 为空</label>");
            return;
        }
        $.cookie('userinfo',$("#username").val() );
         window.location.href = "common_page.html"
    }
</script>
</body>
</html>